<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="vo.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>查看所教授的课程</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../layui/css/layui.css">
<script src="../layui/layui.js" charset="utf-8"></script>
<style type="text/css">
.layui-table th {
	font-size: 18px;
}

.layui-table td {
	font-size: 18px;
}
</style>


</head>
<body bgcolor="#eeeeee">
	<table class="layui-hide" id="test" lay-filter="test"></table>

	<script type="text/html" id="barDemo">
     <a class="layui-btn layui-btn-xs" lay-event="check">查看课程信息</a> 
	</script>


	<script>
layui.use('table', function(){
  var table = layui.table;
  table.render({
    elem: '#test'
    ,toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
    ,defaultToolbar: ['filter', 'exports', 'print']
    ,title: '用户数据表'
    ,cols: [[ //标题栏
	      {field:  'courseno', title: '课程编号', width: 130, sort: true }
	      ,{field: 'coursename', title: '课程名称', width: 160}
	      ,{field: 'credit', title: '学分', width: 80}
	      ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:225}
	    ]]
  ,data: 
      ${tea_queryCourse1_json}
    ,page: true
  });
  
  //头工具栏事件

  //监听行工具事件
  table.on('tool(test)', function(obj){
    var data = obj.data;
    //console.log(obj)
    if(obj.event === 'check'){

	layer.open({
	    type: 2,
	    title:"查看课程信息",
	    offset: 'auto',
	    area:['1000px','600px'],
	    content: 'Tea_QueryCourse2Servlet?courseno=' +data.courseno,
	    end:function(){
			location.reload();
	    }
	  });   
    }
  });
});
</script>

</body>
</html>